package com.yun.many.auth.dao.enums;

import com.yun.many.dao.enums.IDbEnum;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum StatusEnum implements IDbEnum<Integer> {
    ENABLE(1, "启用"),
    DISABLE(0, "禁用");
    private final Integer value;
    private final String desc;

    public static StatusEnum of(Integer value) {
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (statusEnum.value.equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}
